package com.grsu.phonestation.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.grsu.phonestation.dao.impl.TypePaymentDAOImpl;
import com.grsu.phonestation.domain.TypePayment;
import com.grsu.phonestation.service.TypePaymentService;

@Service
@Transactional
public class TypePaymentServiceImpl implements TypePaymentService{

	@Autowired
	private TypePaymentDAOImpl typePaymentDAO;
	
	@Override
	public void addTypePayment(TypePayment typePayment) {
		typePaymentDAO.save(typePayment);
		
	}

	@Override
	public void removeTypePayment(int typePaymentId) {
		typePaymentDAO.remove(typePaymentId);
	
	}

	@Override
	public void updateTypePayment(TypePayment typePayment) {
		typePaymentDAO.update(typePayment);
		
	}
	
	@Override
	public TypePayment findById(Integer typePaymentId){
		return typePaymentDAO.findById(typePaymentId);
	}

	@Override
	public List<TypePayment> listTypePayments() {
		List<TypePayment> typePayments = typePaymentDAO.findAll();
		return typePayments;
	}

}
